package com.tencent.iov.cowin.befsale.clue.dao.http.tencent;

import com.tencent.iov.cowin.befsale.clue.config.MultipartSupportConfig;
import com.software.boot.common.entity.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author xiamu
 * 文件上传接口
 */
@FeignClient(value = "tencent-saas",
        url = "${tencent-saas-host:}",
//        url = "http://base-dev.tencent-saas.innet.dm.newcowin.com/",
        configuration = MultipartSupportConfig.class)
public interface ITencentSaasClient {
    /**
     * 上传文件
     * @param file 文件
     * @param domain 参数
     * @param key key
     * @return 路径
     */
    @PostMapping(value = "/cos/cloud/file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response<String> uploadFile(@RequestPart("file") MultipartFile file,
                                @RequestParam("domain") String domain,
                                @RequestParam("key") String key);
}
